<template>
<!--	登陆页面-->
	<div class="div_app">
		<div class="div_navi" >
			<van-nav-bar
			title="登录"
			/>
		</div>
		<van-form @submit="onSubmit" style="margin-top:0.5rem;" :submit-on-enter="true">
			<van-field
			v-model="dataForm.account"
			name="用户名"
			label="用户名"
			placeholder="用户名"
			:rules="[{ required: true, message: '请填写用户名' }]"/>
			<van-field
			v-model="dataForm.password"
			type="password"
			name="密码"
			label="密码"
			placeholder="密码"
			:rules="[{ required: true, message: '请填写密码' }]"/>
			<div style="margin: 16px;">
				<van-button round block type="info" native-type="submit" @click="confirm">
					提交
				</van-button>
			</div>
		</van-form>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				dataForm: {
					account: "",
					password: ""
				},
				loading: true
			};
		},
		created() {
			let _this = this;
			_this.loading = false;
		},
		methods: {
			onSubmit(){

			},
			confirm() {
				let _this = this;
				_this.loading = true;
				if(this.dataForm.account===""||this.dataForm.password===""){
					this.$toast("用户名或密码不能为空")
					return false
				}else{
					this.$toast.loading({
						message: '登陆中...',
						forbidClick: true,
					});
					this.$router.push('/position/map' );
				// this.$toast.success('登陆成功');
				// 	this.$toast.fail('登陆失败，请确认用户名和密码是否正确');
				}
			}
		}
	}
</script>
<style lang="scss" scoped>

</style>